
cc.Class({
    extends: cc.Component,

    properties:()=>({

        GameCtl:{
            default:null,
            type:require("GameControl"),
        },

        GameingNode:{
            default:null,
            type:cc.Node,
        },
        ReadyNode:{
            default:null,
            type:cc.Node,
        },
        GameOverNode:{
            default:null,
            type:cc.Node,
        },
        ScoreLabel:{
            default:null,
            type:cc.Label,
        },

    }),

    // LIFE-CYCLE CALLBACKS:

    onLoad () {

        //cc.error("UManager Onload");


        this.RestGame();

    },

    RestGame(){
        this.ReadyNode.active =true;
        this.GameingNode.active =false;
        this.GameOverNode.active  =false;
        this.GameCtl.RestGame();
    },


    StartGame(){
        this.ReadyNode.active =false;
        this.GameingNode.active =true;
        this.GameOverNode.active  =false;

        this.GameCtl.StartGame();
    },

    GameOver(){
        this.ReadyNode.active =false;
        this.GameingNode.active =false;
        this.GameOverNode.active  =true;
        this.ScoreLabel.string ="Score:"+this.GameCtl.scoreCtl.score;
    },

    SetOverScore(sc){


    },

    start () {
        //cc.error("Umanager start");


    },

    update (dt) {

        //cc.log("测试成绩是"+GameControl.instance.scoreCtl.score);

    },
});
